<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Person(name){
            this.name = name;
            this.sayName = function(){
                console.log(this.name)
            };
        }
        var p1 = new Person('xxx')
        var p2 = new Person('fyr')
        p1.sayName()
    </script>
</body>
</html>